<style>
#zxzpZpgg .table tr td,
#zxzpZpgg .table tr th {
    text-align: center;
    height: 42px;
    line-height: 42px;
    padding: 0;
}

#zxzpZpgg .top-container {
    padding: 10px;
    background-color: #f5f5f5;
}

#zxzpZpgg .sn-col {
    display: inline-block;
}

#zxzpZpgg .search-text {
    width: 500px !important;
    margin-left: 10px;
}

#zxzpZpgg .list {
    border: 1px solid #ebebeb;
    padding: 10px;
    margin-top: 20px;
}

#zxzpZpggFb {
    padding: 0 15px;
}

#zxzpZpggFb:hover {
    background-color: #fe0103;
}

#zxzpZpggFb img {
    vertical-align: text-bottom;
    margin-right: 7px;
}

#zxzpZpgg #zxzpZpgg2 {
    padding-top: 14px;
}

#zxzpZpgg .t-title {
    width: 110px;
    padding-right: 8px;
    font-size: 12px;
    display: inline-block;
    text-align: right;
}

#zxzpZpgg .t-text {
    height: 32px;
    line-height: 32px;
    border: 1px solid #aadafd;
    display: inline-block;
    text-indent: 4px;
}

#zxzpZpgg .t-text.nomarl {
    width: 145px;
}

#zxzpZpgg2 .t-text.long {
    width: 100%;
    display: inline-block;
}

#zxzpZpgg .t-row {
    margin-bottom: 5px;
}

#zxzpZpgg .t-r {
    color: #ff403e;
    vertical-align: sub;
}

#zxzpZpgg .zxzp-btn-row {
    text-align: center;
    margin-top: 30px;
}

#zxzpZpgg .zxzp-btn {
    font-size: 14px;
    height: 32px;
    line-height: 32px;
    display: inline-block;
    margin: 0 30px;
    cursor: pointer;
}

#zxzpZpgg .zxzp-btn.info {
    color: #fff;
    width: 224px;
    background-color: #3595dc;
}

#zxzpZpgg .zxzp-btn.cancel {
    color: #333;
    width: 224px;
    background-color: #e4e4e4;
}

#zxzpZpgg .zxzp-btn.view {
    width: 512px;
    background-color: #fff;
    color: #000;
    border: 1px solid #f9c15d;
}

#zxzpZpgg .zxzpZpgg-ck-title {
    background-color: #f5f5f5;
    height: 47px;
    line-height: 47px;
    font-size: 16px;
    color: #0071c4;
    text-indent: 10px;
}

#zxzpZpgg .zxzpZgpp-info-title {
    width: 130px;
    text-align: left !important;
    padding-left: 9px !important;
}

#zxzpZpgg .zxzpZgpp-info-content {
    text-align: left !important;
    text-indent: 15px;
}

#zxzpZpgg .gwxx-s-title {
    font-size: 14px;
    font-weight: bold;
    width: 140px;
    display: inline-block;
    text-align: right;
}

#zxzpZpgg .sn-tab-body-item {
    /* height: 310px;
    position: relative;*/
}

#zxzpZpgg .sn-tab-body-item .dp {
    /*  position: absolute;
    width: 100%;
    bottom: 0px;*/
}

#zxzpZpgg #positionController {
    /*-display: none;*/
}

#spyj {
    font-size: 14px;
    padding: 0 10px;
}

#spyj-content {
    color: #f00;
}
</style>
<div id="zxzpZpgg" ms-controller="zxzpZpgg">
    <div class="zxzpZpgg super-level" id="zxzpZpgg1">
        <div class="top-container">
            <div class="">
                <div class="sn-col">
                    <div class="input-group">
                        <button class="btn btn-danger" type="button" id="zxzpZpggFb" data-toggle="modal" data-target="#newJob">
                            <img src="../images/icon_add.png" alt="">发布招聘公告
                        </button>
                    </div>
                </div>
                <div class="sn-col">
                    <div class="input-group search">
                        <input type="text" class="form-control search-text" placeholder="" ms-duplex="searchText">
                        <span class="input-group-btn">
                            <button class="btn btn-info" type="button" ms-click="searhNoticeList">搜索</button>
                        </span>
                    </div>
                </div>
            </div>
        </div>
        <div class="list" id="zxzpZpggList">
            <div class="sn-tab">
                <div class="sn-tab-nav">
                    <div class="sn-tab-nav-item active">草稿({{noticeList.draft.total}})</div>
                    <div class="sn-tab-nav-item">审批中({{noticeList.process.total}})</div>
                    <div class="sn-tab-nav-item">发布中({{noticeList.publish.total}})</div>
                    <div class="sn-tab-nav-item">审批不通过({{noticeList.notPass.total}})</div>
                    <div class="sn-tab-nav-item">已下线({{noticeList.offLine.total}})</div>
                </div>
                <div class="sn-tab-body">
                    <div class="sn-tab-body-item" style="display: block;">
                        <table class="table table-bordered">
                            <tr>
                                <th>招聘公告</th>
                                <th>职位数</th>
                                <th>人数</th>
                                <th>创建时间</th>
                                <th>截止日期</th>
                                <th>操作</th>
                            </tr>
                            <tr ms-repeat="noticeList.draft.data">
                                <td>
                                    <a ms-click="viewNotice(el)">{{el.JobName}}</a>
                                </td>
                                <td>{{el.JobPosCount}}</td>
                                <td>{{el.TotalPeople}}</td>
                                <td>{{el.TimeCreated}}</td>
                                <td>{{el.TimeEnd}}</td>
                                <td>
                                    <button class="btn-sm info" ms-click="maintainPostion(el)" data-toggle="modal" data-target="#positionList">维护岗位信息</button>
                                    <button class="btn-sm info" ms-click="editNotice(el)" data-target="editJob" data-toggle="modal">编辑</button>
                                    <button class="btn-sm info" ms-click="removeNotice(el)">删除</button>
                                </td>
                            </tr>
                        </table>
                        <div id="draftListPager" class="dp" style="text-align: center;"></div>
                    </div>
                    <div class="sn-tab-body-item">
                        <table class="table table-bordered">
                            <tr>
                                <th>招聘公告</th>
                                <th>职位数</th>
                                <th>人数</th>
                                <th>提交审批时间</th>
                                <th>截止日期</th>
                            </tr>
                            <tr ms-repeat="noticeList.process.data">
                                <td>
                                    <a ms-click="viewNotice(el)">{{el.JobName}}</a>
                                </td>
                                <td>{{el.JobPosCount}}</td>
                                <td>{{el.TotalPeople}}</td>
                                <td>{{el.TimeCreated}}</td>
                                <td>{{el.TimeEnd}}</td>
                            </tr>
                        </table>
                        <div id="processListPager" class="dp" style="text-align: center;"></div>
                    </div>
                    <div class="sn-tab-body-item">
                        <table class="table table-bordered">
                            <tr>
                                <th>招聘公告</th>
                                <th>职位数</th>
                                <th>人数</th>
                                <th>发布时间</th>
                                <th>截止日期</th>
                            </tr>
                            <tr ms-repeat="noticeList.publish.data">
                                <td>
                                    <a ms-click="viewNotice(el)">{{el.JobName}}</a>
                                </td>
                                <td>{{el.JobPosCount}}</td>
                                <td>{{el.TotalPeople}}</td>
                                <td>{{el.TimeCreated}}</td>
                                <td>{{el.TimeEnd}}</td>
                            </tr>
                        </table>
                        <div id="publishListPager" class="dp" style="text-align: center;"></div>
                    </div>
                    <div class="sn-tab-body-item">
                        <table class="table table-bordered">
                            <tr>
                                <th>招聘公告</th>
                                <th>职位数</th>
                                <th>人数</th>
                                <th>审批时间</th>
                                <th>截止日期</th>
                                <th>操作</th>
                            </tr>
                            <tr ms-repeat="noticeList.notPass.data">
                                <td>
                                    <a ms-click="viewNotice(el)">{{el.JobName}}</a>
                                </td>
                                <td>{{el.JobPosCount}}</td>
                                <td>{{el.TotalPeople}}</td>
                                <td>{{el.TimeCreated}}</td>
                                <td>{{el.TimeEnd}}</td>
                                <td>
                                    <button class="btn-sm info" ms-click="maintainPostion(el)" data-toggle="modal" data-target="#positionList">维护岗位信息</button>
                                    <button class="btn-sm info" class="dp" ms-click="editNotice(el)" data-target="editJob" data-toggle="modal">编辑</button>
                                </td>
                            </tr>
                        </table>
                        <div id="notPassListPager" class="dp" style="text-align: center;"></div>
                    </div>
                    <div class="sn-tab-body-item">
                        <table class="table table-bordered">
                            <tr>
                                <th>招聘公告</th>
                                <th>职位数</th>
                                <th>人数</th>
                                <th>发布时间</th>
                                <th>截止日期</th>
                            </tr>
                            <tr ms-repeat="noticeList.offLine.data">
                                <td>
                                    <a ms-click="viewNotice(el)">{{el.JobName}}</a>
                                </td>
                                <td>{{el.JobPosCount}}</td>
                                <td>{{el.TotalPeople}}</td>
                                <td>{{el.TimeCreated}}</td>
                                <td>{{el.TimeEnd}}</td>
                            </tr>
                        </table>
                        <div id="offLineListPager" class="dp" style="text-align: center;"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="newJob" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document" style="width: 822px;">
            <div class="modal-content" style="border-radius: 0;">
                <div class="modal-header" style="border-bottom-color:#237dc2;margin: 0 15px; text-indent: 15px;">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close" id="closeNewJob"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel" style="color: #237dc2;font-size: 16px;">新增招聘公告</h4>
                </div>
                <div class="modal-body">
                    <div>
                        <div style="display: table;width: 100%;" class="t-row">
                            <div class="t-title" style="display: table-cell;">
                                <span class="t-r">*</span>
                                <span>招聘信息标题</span>
                            </div>
                            <div style="padding-left: 4px;">
                                <input type="text" class="t-text long" style="width: 652px;" ms-duplex="notice.newJob.JobName">
                            </div>
                        </div>
                        <div class="t-row">
                            <div class="t-title" style="width: 101.5px;margin-right: 9px;">
                                <span>招聘计划年度</span>
                            </div>
                            <select class="t-text nomarl" ms-duplex="notice.newJob.Year">
                                <option ms-repeat="notice.dropdownList.years">{{el}}</option>
                            </select>
                            <div class="t-title" style="width: 101.5px;">
                                <span>招聘单位</span>
                            </div>
                            <input type="text" class="t-text nomarl" ms-duplex="userInfo.DepartmentName" readonly="true">
                        </div>
                        <div style="display: table;width: 100%;" class="t-row">
                            <div class="t-title" style="display: table-cell;">
                                <span class="t-r">*</span>
                                <span>招聘目的及说明</span>
                            </div>
                            <div style="padding-left: 4px;">
                                <input type="text" class="t-text long" style="width: 652px;" value="招聘目的及说明" ms-duplex="notice.newJob.Caption">
                            </div>
                        </div>
                        <div class="t-row">
                            <div class="t-title">
                                <span class="t-r">*</span>
                                <span>录用形式</span>
                            </div>
                            <select name="" id="" class="t-text nomarl">
                                <option value="" selected="selected">调动</option>
                            </select>
                            <div class="t-title" style="width: 101.5px;">
                                <span class="t-r">*</span>
                                <span>报名开始日期</span>
                            </div>
                            <input type="text" class="t-text nomarl" value="" ms-duplex="notice.newJob.TimeStart" onClick="WdatePicker()">
                            <div class="t-title" style="width: 101.5px;">
                                <span class="t-r">*</span>
                                <span>报名截止日期</span>
                            </div>
                            <input type="text" class="t-text nomarl" value="" ms-duplex="notice.newJob.TimeEnd" onClick="WdatePicker()">
                        </div>
                        <div class="t-row">
                            <div class="t-title">
                                <span class="t-r">*</span>
                                <span>联系人</span>
                            </div>
                            <input type="text" class="t-text nomarl" ms-duplex="notice.newJob.Linkman">
                            <div class="t-title" style="width: 101.5px;">
                                <span class="t-r">*</span>
                                <span>联系电话</span>
                            </div>
                            <input type="text" class="t-text nomarl" ms-duplex="notice.newJob.Contacts">
                            <div class="t-title" style="width: 101.5px;">
                                <span>邮箱</span>
                            </div>
                            <input type="text" class="t-text nomarl" value="" ms-duplex="notice.newJob.Email">
                        </div>
                        <div class="t-row">
                            <div class="t-title" style="vertical-align: top;">
                                <span class="t-r">*</span>
                                <span>招聘面向单位</span>
                            </div>
                            <div class="dropdown-content">
                                <input type="text" class="checks_v t-text nomarl enterprise" keys="" readonly="true" />
                            </div>
                        </div>
                        <div class="zxzp-btn-row">
                            <div class="zxzp-btn info" onclick="saveNotice()">保存</div>
                            <div class="zxzp-btn cancel" data-dismiss="modal">取消</div>
                        </div>
                    </div>
                    <!--   <div style="margin-top: 40px;" id="positionController">
                        <div style="height: 20px;vertical-align: bottom;" class="t-row">
                            <div style="font-size: 16px;text-indent: 10px;float: left;">
                                岗位信息
                            </div>
                            <div class="zxzpZpggGW" style="float: right;padding:0 10px;font-size: 16px;cursor: pointer;color: #ff403e;" data-toggle="modal" data-target="#newPosition">
                                +&nbsp;新增岗位
                            </div>
                        </div>
                        <div class="positionList">
                            <table class="table table-bordered">
                                <tr>
                                    <th>序号</th>
                                    <th>岗位名称</th>
                                    <th>工作地点</th>
                                    <th>招聘人数</th>
                                    <th>操作</th>
                                </tr>
                                <tr ms-repeat="notice.positionList">
                                    <td>{{$index+1}}</td>
                                    <td>{{el.PositionName}}</td>
                                    <td>{{el.GZDDch}}</td>
                                    <td>{{el.Number}}</td>
                                    <td>
                                        <button class="btn-sm btn-info" ms-click="editPosition(el)" data-toggle="modal" data-target="#editPosition">编辑</button>
                                        <button class="btn-sm btn-danger" ms-click="removePosition(el)">删除</button>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div> -->
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="editJob" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" onclick="hideEditJob()">
        <div class="modal-dialog" role="document" style="width: 822px;">
            <div class="modal-content" style="border-radius: 0;">
                <div class="modal-header" style="border-bottom-color:#237dc2;margin: 0 15px; text-indent: 15px;">
                    <button type="button" class="close"><span aria-hidden="true" onclick="hideEditJob()" id="closeEditJob">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel" style="color: #237dc2;font-size: 16px;">编辑招聘公告</h4>
                </div>
                <div class="modal-body">
                    <div>
                        <div style="display: table;width: 100%;" class="t-row">
                            <div class="t-title" style="display: table-cell;">
                                <span class="t-r">*</span>
                                <span>招聘信息标题</span>
                            </div>
                            <div style="padding-left: 4px;">
                                <input type="text" class="t-text long" style="width: 652px;" ms-duplex="notice.editJob.JobName">
                            </div>
                        </div>
                        <div class="t-row">
                            <div class="t-title">
                                <span>招聘信息编号</span>
                            </div>
                            <span class="t-text nomarl">{{notice.editJob.JobCode}}</span>
                            <div class="t-title" style="width: 101.5px;">
                                <span>招聘计划年度</span>
                            </div>
                            <select class="t-text nomarl" ms-duplex="notice.editJob.Year">
                                <option ms-repeat="notice.dropdownList.years">{{el}}</option>
                            </select>
                            <div class="t-title" style="width: 101.5px;">
                                <span>招聘单位</span>
                            </div>
                            <input type="text" class="t-text nomarl" ms-duplex="userInfo.DepartmentName" readonly="true">
                        </div>
                        <div style="display: table;width: 100%;" class="t-row">
                            <div class="t-title" style="display: table-cell;">
                                <span class="t-r">*</span>
                                <span>招聘目的及说明</span>
                            </div>
                            <div style="padding-left: 4px;">
                                <input type="text" class="t-text long" style="width: 652px;" value="招聘目的及说明" ms-duplex="notice.editJob.Caption">
                            </div>
                        </div>
                        <div class="t-row">
                            <div class="t-title">
                                <span class="t-r">*</span>
                                <span>录用形式</span>
                            </div>
                            <select name="" id="" class="t-text nomarl">
                                <option value="" selected="selected">调动</option>
                            </select>
                            <div class="t-title" style="width: 101.5px;">
                                <span class="t-r">*</span>
                                <span>报名开始日期</span>
                            </div>
                            <input type="text" class="t-text nomarl" value="" ms-duplex="notice.editJob.TimeStart" onClick="WdatePicker()">
                            <div class="t-title" style="width: 101.5px;">
                                <span class="t-r">*</span>
                                <span>报名截止日期</span>
                            </div>
                            <input type="text" class="t-text nomarl" value="" ms-duplex="notice.editJob.TimeEnd" onClick="WdatePicker()">
                        </div>
                        <div class="t-row">
                            <div class="t-title">
                                <span class="t-r">*</span>
                                <span>联系人</span>
                            </div>
                            <input type="text" class="t-text nomarl" ms-duplex="notice.editJob.Linkman">
                            <div class="t-title" style="width: 101.5px;">
                                <span class="t-r">*</span>
                                <span>联系电话</span>
                            </div>
                            <input type="text" class="t-text nomarl" ms-duplex="notice.editJob.Contacts">
                            <div class="t-title" style="width: 101.5px;">
                                <span>邮箱</span>
                            </div>
                            <input type="text" class="t-text nomarl" value="" ms-duplex="notice.editJob.Email">
                        </div>
                        <div class="t-row">
                            <div class="t-title" style="vertical-align: top;">
                                <span class="t-r">*</span>
                                <span>招聘面向单位</span>
                            </div>
                            <div class="" style="z-index:999;display: inline-block;">
                                <input type="text" class="checks_v t-text nomarl enterprise" keys="" readonly="true" />
                            </div>
                        </div>
                        <div class="zxzp-btn-row">
                            <div class="zxzp-btn info" onclick="updateNotice()">保存</div>
                            <div class="zxzp-btn cancel" data-dismiss="modal">取消</div>
                        </div>
                    </div>
                    <!--  <div style="margin-top: 40px;" id="positionController">
                        <div style="height: 20px;vertical-align: bottom;" class="t-row">
                            <div style="font-size: 16px;text-indent: 10px;float: left;">
                                岗位信息
                            </div>
                            <div class="zxzpZpggGW" style="float: right;padding-right:0 10px;font-size: 16px;cursor: pointer;color: #ff403e;" data-toggle="modal" data-target="#newPosition">
                                +&nbsp;新增岗位
                            </div>
                        </div>
                        <div class="positionList">
                            <table class="table table-bordered">
                                <tr>
                                    <th>序号</th>
                                    <th>岗位名称</th>
                                    <th>工作地点</th>
                                    <th>招聘人数</th>
                                    <th>操作</th>
                                </tr>
                                <tr ms-repeat="notice.positionList">
                                    <td>{{$index+1}}</td>
                                    <td>{{el.PositionName}}</td>
                                    <td>{{el.GZDDch}}</td>
                                    <td>{{el.Number}}</td>
                                    <td>
                                        <button class="btn-sm btn-info" ms-click="editPosition(el)" data-toggle="modal" data-target="#editPosition">编辑</button>
                                        <button class="btn-sm btn-danger" ms-click="removePosition(el)">删除</button>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div> -->
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="positionList" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" onclick="">
        <div class="modal-dialog" role="document" style="width: 822px;">
            <div class="modal-content" style="border-radius: 0;">
                <div class="modal-header" style="border-bottom-color:#237dc2;margin: 0 15px; text-indent: 15px;">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true" onclick="" id="">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel" style="color: #237dc2;font-size: 16px;">岗位信息</h4>
                </div>
                <div class="modal-body">
                    <div style="height: 20px;vertical-align: bottom;" class="t-row">
                        <div class="zxzpZpggGW" style="float: right;padding-right:0 10px;font-size: 16px;cursor: pointer;color: #ff403e;" data-toggle="modal" data-target="#newPosition">
                            +&nbsp;新增岗位
                        </div>
                    </div>
                    <div class="positionList">
                        <table class="table table-bordered">
                            <tr>
                                <th>序号</th>
                                <th>岗位名称</th>
                                <th>工作地点</th>
                                <th>招聘人数</th>
                                <th>操作</th>
                            </tr>
                            <tr ms-repeat="notice.positionList">
                                <td>{{$index+1}}</td>
                                <td>{{el.PositionName}}</td>
                                <td>{{el.GZDDch}}</td>
                                <td>{{el.Number}}</td>
                                <td>
                                    <button class="btn-sm btn-info" ms-click="editPosition(el)" data-toggle="modal" data-target="#editPosition">编辑</button>
                                    <button class="btn-sm btn-danger" ms-click="removePosition(el)">删除</button>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="newPosition" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document" style="width: 822px;">
            <div class="modal-content" style="border-radius: 0;">
                <div class="modal-header" style="border-bottom-color:#237dc2;margin: 0 15px; text-indent: 15px;">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel" style="color: #237dc2;font-size: 16px;">新建岗位</h4>
                </div>
                <div class="modal-body">
                    <div class="t-row">
                        <div class="t-title">
                            <span class="t-r">*</span>
                            <span>岗位名称</span>
                        </div>
                        <input type="text" class="t-text nomarl" ms-duplex="notice.newPosition.PositionName">
                        <div class="t-title" style="width: 101.5px;">
                            <span class="t-r">*</span>
                            <span>招聘人数</span>
                        </div>
                        <input type="text" class="t-text nomarl" ms-duplex="notice.newPosition.Number">
                    </div>
                    <div class="t-row">
                        <div class="t-title">
                            <span class="t-r">*</span>
                            <span>工作单位</span>
                        </div>
                        <input type="text" class="t-text normal" style="width: 399px;" ms-duplex="notice.newPosition.Department">
                        <div class="t-title" style="width: 101px;">
                            <span>工作地点</span>
                        </div>
                        <select name="" id="" class="t-text nomarl" ms-duplex="notice.newPosition.WorkLocation">
                            <option ms-attr-value="el.id" ms-repeat="notice.dropdownList.positionLoctionList">{{el.Name}}</option>
                        </select>
                    </div>
                    <div style="display: table;width: 100%;" class="t-row">
                        <div class="t-title" style="display: table-cell;">
                            <span>岗位职责</span>
                        </div>
                        <div style="padding-left: 4px;">
                            <input type="text" class="t-text long" style="width: 399px;" ms-duplex="notice.newPosition.Duties">
                        </div>
                    </div>
                    <div class="t-row">
                        <div class="t-title">
                            <span class="t-r">*</span>
                            <span>岗位类别</span>
                        </div>
                        <select name="" id="" class="t-text nomarl" ms-duplex="notice.newPosition.Type">
                            <option ms-attr-value="el.Id" ms-repeat="notice.dropdownList.positionTypeList">{{el.Name}}</option>
                        </select>
                        <div class="t-title" style="width: 101.5px;">
                            <span>所属专业</span>
                        </div>
                        <select name="" id="" class="t-text nomarl" ms-duplex="notice.newPosition.SpecialtyDirection">
                            <option ms-attr-value="el.Id" ms-repeat="notice.dropdownList.sszy">{{el.Name}}</option>
                        </select>
                        <div class="t-title" style="width: 101.5px;">
                            <span>所属职业工种</span>
                        </div>
                        <select name="" id="" class="t-text nomarl" ms-duplex="notice.newPosition.SpecialtyDirection2">
                            <option ms-attr-value="el.Id" ms-repeat="notice.dropdownList.sszygz">{{el.Name}}</option>
                        </select>
                    </div>
                    <div style="border-bottom: 1px solid #cacaca;clear: both;margin: 20px 0;">
                    </div>
                    <div class="t-row">
                        <div class="t-title">
                            <span>年龄要求</span>
                        </div>
                        <select name="" id="" class="t-text" style="width: 98px;" ms-duplex="notice.newPosition.AgeBegin">
                            <option ms-attr-value="el" ms-repeat="notice.ages">{{el}}</option>
                        </select>
                        <span>&nbsp;&nbsp;&nbsp;&nbsp;至&nbsp;&nbsp;&nbsp;&nbsp;</span>
                        <select name="" id="" class="t-text" style="width: 98px;" ms-duplex="notice.newPosition.AgeEnd">
                            <option ms-attr-value="el" ms-repeat="notice.ages">{{el}}</option>
                        </select>
                        <div class="t-title" style="width: 158px;">
                            <span>工作年限要求</span>
                        </div>
                        <select name="" id="" class="t-text" style="width: 98px;" ms-duplex="notice.newPosition.WorkYearBegin">
                            <option ms-attr-value="el" ms-repeat="notice.workYears">{{el}}</option>
                        </select>
                        <span>&nbsp;&nbsp;&nbsp;&nbsp;至&nbsp;&nbsp;&nbsp;&nbsp;</span>
                        <select name="" id="" class="t-text" style="width: 98px;" ms-duplex="notice.newPosition.WorkYearEnd">
                            <option ms-attr-value="el" ms-repeat="notice.workYears">{{el}}</option>
                        </select>
                    </div>
                    <div class="t-row">
                        <div class="t-title">
                            <span>学历要求</span>
                        </div>
                        <select name="" id="" class="t-text" style="width: 243.5px;" ms-duplex="notice.newPosition.SLABS">
                            <option ms-attr-value="el.Id" ms-repeat="notice.dropdownList.xlyq">{{el.Name}}</option>
                        </select>
                        <div class="t-title" style="width: 158px;">
                            <span>职称要求</span>
                        </div>
                        <select name="" id="" class="t-text" style="width: 243.5px;" ms-duplex="notice.newPosition.ZYJSZGDJ">
                            <option ms-attr-value="el.Id" ms-repeat="notice.dropdownList.zcyq">{{el.Name}}</option>
                        </select>
                    </div>
                    <div class="t-row">
                        <div class="t-title">
                            <span>技能等级要求</span>
                        </div>
                        <select name="" id="" class="t-text" style="width: 243.5px;" ms-duplex="notice.newPosition.ZYJNDJ">
                            <option ms-attr-value="el.Id" ms-repeat="notice.dropdownList.zndj">{{el.Name}}</option>
                        </select>
                    </div>
                    <div style="display: table;width: 100%;" class="t-row">
                        <div class="t-title" style="display: table-cell;vertical-align: top;">
                            <span>其他要求</span>
                        </div>
                        <div style="padding-left: 4px;padding-right: 24px;">
                            <textarea ms-duplex="notice.newPosition.PositionCondition" class="t-text long" style="height: 64px;max-height: 64px;resize:none;width:100%;"></textarea>
                        </div>
                    </div>
                    <div class="zxzp-btn-row">
                        <div class="zxzp-btn info" onclick="savePosition()">保存</div>
                        <div class="zxzp-btn cancel" id="cancelSavePostion" data-dismiss="modal">取消</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="editPosition" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document" style="width: 822px;">
            <div class="modal-content" style="border-radius: 0;">
                <div class="modal-header" style="border-bottom-color:#237dc2;margin: 0 15px; text-indent: 15px;">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel" style="color: #237dc2;font-size: 16px;">编辑岗位</h4>
                </div>
                <div class="modal-body">
                    <div class="t-row">
                        <div class="t-title">
                            <span class="t-r">*</span>
                            <span>岗位名称</span>
                        </div>
                        <input type="text" class="t-text nomarl" ms-duplex="notice.editPosition.PositionName">
                        <div class="t-title" style="width: 101.5px;">
                            <span class="t-r">*</span>
                            <span>招聘人数</span>
                        </div>
                        <input type="text" class="t-text nomarl" ms-duplex="notice.editPosition.Number">
                    </div>
                    <div class="t-row">
                        <div class="t-title">
                            <span class="t-r">*</span>
                            <span>工作单位</span>
                        </div>
                        <input type="text" class="t-text normal" style="width: 399px;" ms-duplex="notice.editPosition.Department">
                        <div class="t-title" style="width: 101px;">
                            <span>工作地点</span>
                        </div>
                        <select name="" id="" class="t-text nomarl" ms-duplex="notice.editPosition.WorkLocation">
                            <option ms-attr-value="el.id" ms-repeat="notice.dropdownList.positionLoctionList">{{el.Name}}</option>
                        </select>
                    </div>
                    <div style="display: table;width: 100%;" class="t-row">
                        <div class="t-title" style="display: table-cell;">
                            <span>岗位职责</span>
                        </div>
                        <div style="padding-left: 4px;">
                            <input type="text" class="t-text long" style="width: 399px;" ms-duplex="notice.editPosition.Duties">
                        </div>
                    </div>
                    <div class="t-row">
                        <div class="t-title">
                            <span class="t-r">*</span>
                            <span>岗位类别</span>
                        </div>
                        <select name="" id="" class="t-text nomarl" ms-duplex="notice.editPosition.Type">
                            <option ms-attr-value="el.Id" ms-repeat="notice.dropdownList.positionTypeList">{{el.Name}}</option>
                        </select>
                        <div class="t-title" style="width: 101.5px;">
                            <span>所属专业</span>
                        </div>
                        <select name="" id="" class="t-text nomarl" ms-duplex="notice.editPosition.SpecialtyDirection">
                            <option ms-attr-value="el.Id" ms-repeat="notice.dropdownList.sszy">{{el.Name}}</option>
                        </select>
                        <div class="t-title" style="width: 101.5px;">
                            <span>所属职业工种</span>
                        </div>
                        <select name="" id="" class="t-text nomarl" ms-duplex="notice.editPosition.SpecialtyDirection2">
                            <option ms-attr-value="el.Id" ms-repeat="notice.dropdownList.sszygz">{{el.Name}}</option>
                        </select>
                    </div>
                    <div style="border-bottom: 1px solid #cacaca;clear: both;margin: 20px 0;">
                    </div>
                    <div class="t-row">
                        <div class="t-title">
                            <span>年龄要求</span>
                        </div>
                        <select name="" id="" class="t-text" style="width: 98px;" ms-duplex="notice.editPosition.AgeBegin">
                            <option ms-attr-value="el" ms-repeat="notice.ages">{{el}}</option>
                        </select>
                        <span>&nbsp;&nbsp;&nbsp;&nbsp;至&nbsp;&nbsp;&nbsp;&nbsp;</span>
                        <select name="" id="" class="t-text" style="width: 98px;" ms-duplex="notice.editPosition.AgeEnd">
                            <option ms-attr-value="el" ms-repeat="notice.ages">{{el}}</option>
                        </select>
                        <div class="t-title" style="width: 158px;">
                            <span>工作年限要求</span>
                        </div>
                        <select name="" id="" class="t-text" style="width: 98px;" ms-duplex="notice.editPosition.WorkYearBegin">
                            <option ms-attr-value="el" ms-repeat="notice.workYears">{{el}}</option>
                        </select>
                        <span>&nbsp;&nbsp;&nbsp;&nbsp;至&nbsp;&nbsp;&nbsp;&nbsp;</span>
                        <select name="" id="" class="t-text" style="width: 98px;" ms-duplex="notice.editPosition.WorkYearEnd">
                            <option ms-attr-value="el" ms-repeat="notice.workYears">{{el}}</option>
                        </select>
                    </div>
                    <div class="t-row">
                        <div class="t-title">
                            <span>学历要求</span>
                        </div>
                        <select name="" id="" class="t-text" style="width: 243.5px;" ms-duplex="notice.editPosition.SLABS">
                            <option ms-attr-value="el.Id" ms-repeat="notice.dropdownList.xlyq">{{el.Name}}</option>
                        </select>
                        <div class="t-title" style="width: 158px;">
                            <span>职称要求</span>
                        </div>
                        <select name="" id="" class="t-text" style="width: 243.5px;" ms-duplex="notice.editPosition.ZYJSZGDJ">
                            <option ms-attr-value="el.Id" ms-repeat="notice.dropdownList.zcyq">{{el.Name}}</option>
                        </select>
                    </div>
                    <div class="t-row">
                        <div class="t-title">
                            <span>技能等级要求</span>
                        </div>
                        <select name="" id="" class="t-text" style="width: 243.5px;" ms-duplex="notice.editPosition.ZYJNDJ">
                            <option ms-attr-value="el.Id" ms-repeat="notice.dropdownList.zndj">{{el.Name}}</option>
                        </select>
                    </div>
                    <div style="display: table;width: 100%;" class="t-row">
                        <div class="t-title" style="display: table-cell;vertical-align: top;">
                            <span>其他要求</span>
                        </div>
                        <div style="padding-left: 4px;padding-right: 24px;">
                            <textarea ms-duplex="notice.editPosition.PositionCondition" class="t-text long" style="height: 64px;max-height: 64px;resize:none;width: 100%;"></textarea>
                        </div>
                    </div>
                    <div class="zxzp-btn-row">
                        <div class="zxzp-btn info" onclick="updatePosition()">保存</div>
                        <div class="zxzp-btn cancel" id="cancelUpdatePosition" data-dismiss="modal">取消</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="viewJob" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" onclick="hideViewJob()">
        <div class="modal-dialog" role="document" style="width: 822px;">
            <div class="modal-content" style="border-radius: 0;">
                <div class="modal-header" style="border-bottom-color:#237dc2;margin: 0 15px; text-indent: 15px;">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true" onclick="hideViewJob()" id="closeViewJob">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel" style="color: #237dc2;font-size: 16px;">{{notice.viewJob.JobName}}</h4>
                </div>
                <div class="modal-body">
                    <div>
                        <div id="spyj">
                            <p>审批意见</p>
                            <p id="spyj-content">
                                {{notice.viewJob.Notes}}
                            </p>
                        </div>
                        <div style="margin-top:25px;padding: 0 10px; ">
                            <div style="width: 35%;display: inline-block;font-size:14px;">
                                <span>招聘信息编号：</span>
                                <span>{{notice.viewJob.JobCode}}</span>
                            </div>
                            <div style="width: 35%;display: inline-block;font-size:14px;">
                                <span>招聘计划年度：</span>
                                <span>{{notice.viewJob.Year}}</span>
                            </div>
                            <div style="width: 24%;display: inline-block;font-size:14px;">
                                <span>招聘单位：</span>
                                <span>{{userInfo.DepartmentName}}</span>
                            </div>
                        </div>
                        <div style="margin-top: 5px;">
                            <table class="table table-bordered">
                                <tr>
                                    <td class="zxzpZgpp-info-title">招聘目的及说明</td>
                                    <td class="zxzpZgpp-info-content">{{notice.viewJob.Caption}}</td>
                                </tr>
                                <tr>
                                    <td class="zxzpZgpp-info-title">录用形式</td>
                                    <td class="zxzpZgpp-info-content">{{notice.viewJob.DeployMode}}</td>
                                </tr>
                                <tr>
                                    <td class="zxzpZgpp-info-title">报名截止日期</td>
                                    <td class="zxzpZgpp-info-content">{{notice.viewJob.TimeEnd}}</td>
                                </tr>
                                <tr>
                                    <td class="zxzpZgpp-info-title">联系方式</td>
                                    <td class="zxzpZgpp-info-content">{{notice.viewJob.Linkman}}</td>
                                </tr>
                                <tr>
                                    <td class="zxzpZgpp-info-title">招聘面向单位</td>
                                    <td id="zpmxdw" class="zxzpZgpp-info-content"></td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    <div style="margin-top: 15px;">
                        <p style="font-size: 16px;padding-left: 10px;">岗位信息</p>
                        <table class="table table-bordered">
                            <tr>
                                <th>序号</th>
                                <th>岗位名称</th>
                                <th>工作单位</th>
                                <th>工作地点</th>
                                <th>招聘人数</th>
                            </tr>
                            <tr ms-repeat="notice.positionList">
                                <td>{{$index+1}}</td>
                                <td>{{el.PositionName}}</td>
                                <td>工作单位</td>
                                <td>{{el.GZDDch}}</td>
                                <td>{{el.Number}}</td>
                            </tr>
                        </table>
                        <div class="zxzp-btn-row">
                            <div class="zxzp-btn info" onclick="submitNotice()" id="sbsh">上报审核</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
var zxzpZpgg = avalon.define({
    $id: "zxzpZpgg",
    userInfo: {},
    searchText: '',
    removeNotice: function(el) {
        var id = el.Id;
        $.post(DelJob, {
            jobid: id
        }, function(result) {
            if (result.Status == true) {
                var curr = $("#draftListPager li.active a").text();
                getJobListByStatus(false, 0, 'draft', 5, curr);
            }
        }, 'json');
    },
    editNotice: function(el) {
        var noticeId = el.Id;
        var data = {
            jobId: noticeId
        };
        zxzpZpgg.notice.jobId = el.Id;
        $.post(GetJobById, data, function(result) {
            if (result.Status == true) {
                //赋值操作
                $("#editJob").show().addClass('in');
                $("body").append('<div class="modal-backdrop fade in" id="editJobModal"></div>');
                var ListRange = result.Message.ListRange;
                var listRange = [];
                var options = zxzpZpgg.notice.dropdownList.units.$model;
                var depNameList = [];
                for (var i = 0; i < ListRange.length; i++) {
                    listRange.push(ListRange[i].DepartmentId);
                    for (var j = 0; j < options.length; j++) {
                        if (ListRange[i].DepartmentId == options[j].DeptID) {
                            depNameList.push(options[j].Name);
                        }
                    }
                }
                zxzpZpgg.notice.editJob = result.Message;
                $("#editJob .enterprise").attr("keys", listRange.toString());
                $("#editJob .enterprise").val(depNameList.toString());
            }
        }, 'json');
        GetPositionByJobId(noticeId);
    },
    maintainPostion: function(el) {
        var noticeId = el.Id;
        var data = {
            jobId: noticeId
        };
        zxzpZpgg.notice.jobId = el.Id;
        GetPositionByJobId(noticeId);
    },
    viewNotice: function(el) {
        var noticeId = el.Id;
        var data = {
            jobId: noticeId
        };
        zxzpZpgg.notice.jobId = el.Id;
        $.post(GetJobById, data, function(result) {
            if (result.Status == true) {
                //赋值操作
                var ListRange = result.Message.ListRange;
                var listRange = [];
                var options = zxzpZpgg.notice.dropdownList.units.$model;
                var depNameList = [];
                for (var i = 0; i < ListRange.length; i++) {
                    listRange.push(ListRange[i].DepartmentId);
                    for (var j = 0; j < options.length; j++) {
                        if (ListRange[i].DepartmentId == options[j].DeptID) {
                            depNameList.push(options[j].Name);
                        }
                    }
                }
                $("#sbsh").hide();
                $("#spyj").hide();
                if (result.Message.Status == "0") {
                    $("#sbsh").show();
                }
                if (result.Message.Status == "12") {
                    $("#sbsh").show();
                    $("#spyj").show();
                }
                zxzpZpgg.notice.editJob = result.Message;
                $("#zpmxdw").html(depNameList.toString());
                $("#viewJob").show().addClass('in');
                $("body").append('<div class="modal-backdrop fade in" id="viewJobModal"></div>');
                zxzpZpgg.notice.viewJob = result.Message;
            }
        }, 'json');
        GetPositionByJobId(noticeId);
    },
    searhNoticeList: function() {
        var keywords = zxzpZpgg.searchText;
        getDefault(keywords);
    },
    editPosition: function(el) {
        zxzpZpgg.notice.editPosition = el.$model;
    },
    removePosition: function(el) {
        var id = el.Id;
        $.post(DelPosition, {
            id: id
        }, function(result) {
            if (result.Status == true) {
                //回调                
                GetPositionByJobId(zxzpZpgg.notice.jobId);
            }
        }, 'json');
    },
    noticeList: {
        draft: {
            total: 0,
            data: []
        },
        process: {
            total: 0,
            data: []
        },
        publish: {
            total: 0,
            data: []
        },
        notPass: {
            total: 0,
            data: []
        },
        offLine: {
            total: 0,
            data: []
        }
    },
    notice: {
        jobId: '',
        ages: [
            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
        ],
        workYears: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50],
        dropdownList: {
            years: [],
            units: [],
            positionLoctionList: [],
            positionTypeList: [],
            sszy: [],
            sszygz: [],
            xlyq: [],
            zcyq: [],
            zndj: []
        },
        viewJob: {},
        editJob: {},
        newJob: {
            JobName: '', //招聘信息名称
            JobCode: '', //招聘信息编号
            Year: '', //招聘计划年度
            DeployMode: '调入', //录用形式
            jobID: '', //招聘信息ID
            TimeStart: '', //开始时间
            TimeEnd: '', //结束时间         
            Caption: '', //招聘目的及说明
            Linkman: '', //联系人
            Contacts: '', //联系电话
            Email: '' //邮箱            
        },
        newPosition: {
            PositionNum: '', //岗位编号
            PositionName: '', //岗位名称
            Type: '', //岗位类别
            PositionList: '', //岗位分类序列
            SpecialtyDirection: '', //所属专业
            SpecialtyDirection2: '', //所属职业（工种）
            Department: '', //工作单位
            Duties: '', //岗位职责
            Number: '', //招聘人数
            WorkLocation: '', //工作地点
            PositionDsc: '', //岗位描述
            Remarks: '', //备注
            PositionCondition: '', //其他要求
            AgeBegin: '', //最低年龄
            AgeEnd: '', //最高年龄
            WorkYearBegin: '', //最短年限
            WorkYearEnd: '', //最长年限
            SLABS: '', //学历要求
            ZYJSZGDJ: '', //职称要求
            ZYJNDJ: '' //职业技能等级要求
        },
        editPosition: {},
        positionList: []
    }
});
(function() {
    if (window.initDropdownList) {
        setDropdown();
        setTimeout(zxzpZpggInit, 0);
    } else {
        $.get(GetInitDropdownList, function(data) {
            if (data.Status == true) {
                window.initDropdownList = data.Message;
                setDropdown();
                setTimeout(zxzpZpggInit, 0);
            }
        }, 'json');
    }
    if (window.userInfo) {
        setUserInfo();
    } else {
        $.get(getUserInfo, function(data) {
            if (data.result.Status == true) {
                window.userInfo = data.Message;
                setUserInfo();
            }
        }, 'json')
    }
    $("#zxzpZpggFb").click(function(event) {
        zxzpZpgg.notice.newJob.JobName = '';
        zxzpZpgg.notice.newJob.JobCode = '';
        zxzpZpgg.notice.newJob.Year = '';
        zxzpZpgg.notice.newJob.DeployMode = '调入';
        zxzpZpgg.notice.newJob.jobID = '';
        zxzpZpgg.notice.newJob.TimeStart = '';
        zxzpZpgg.notice.newJob.TimeEnd = '';
        zxzpZpgg.notice.newJob.Caption = '';
        zxzpZpgg.notice.newJob.Linkman = '';
        zxzpZpgg.notice.newJob.Contacts = '';
        zxzpZpgg.notice.newJob.Email = '';
        $(".enterprise").val("").attr("keys", "");
        zxzpZpgg.notice.positionList = [];
    });
    $(".zxzpZpggGW").click(function(event) {
        zxzpZpgg.notice.newPosition.PositionNum = '';
        zxzpZpgg.notice.newPosition.PositionName = '';
        zxzpZpgg.notice.newPosition.Type = '';
        zxzpZpgg.notice.newPosition.PositionList = '';
        zxzpZpgg.notice.newPosition.SpecialtyDirection = '';
        zxzpZpgg.notice.newPosition.SpecialtyDirection2 = '';
        zxzpZpgg.notice.newPosition.Department = '';
        zxzpZpgg.notice.newPosition.Duties = '';
        zxzpZpgg.notice.newPosition.Number = '';
        zxzpZpgg.notice.newPosition.WorkLocation = '';
        zxzpZpgg.notice.newPosition.PositionDsc = '';
        zxzpZpgg.notice.newPosition.Remarks = '';
        zxzpZpgg.notice.newPosition.PositionCondition = '';
        zxzpZpgg.notice.newPosition.AgeBegin = '';
        zxzpZpgg.notice.newPosition.AgeEnd = '';
        zxzpZpgg.notice.newPosition.WorkYearBegin = '';
        zxzpZpgg.notice.newPosition.WorkYearEnd = '';
        zxzpZpgg.notice.newPosition.SLABS = '';
        zxzpZpgg.notice.newPosition.ZYJSZGDJ = '';
        zxzpZpgg.notice.newPosition.ZYJNDJ = '';
    });
})();

function verifyPosition(position) {
    if (!position.PositionName) {
        layer.alert("请输入岗位名称", {
            title: "提示信息",
            time: 1500
        });
        return false;
    }
    if (!isPInt(position.Number)) {
        layer.alert("请输入正确的岗位人数", {
            title: "提示信息",
            time: 1500
        });
        return false;
    }
    if (!position.Department) {
        layer.alert("请输入工作单位", {
            title: "提示信息",
            time: 1500
        });
        return false;
    }
    if (!position.Type) {
        layer.alert("请选择岗位类别", {
            title: "提示信息",
            time: 1500
        });
        return false;
    }
    return true;
}

function verifyJob(job) {
    if (!job.JobName) {
        layer.alert("请输入招聘公告名称", {
            title: "提示信息",
            time: 1500
        });
        return false;
    }
    if (!job.Year) {
        layer.alert("请选择招聘计划年度", {
            title: "提示信息",
            time: 1500
        });
        return false;
    }
    if (!job.Caption) {
        layer.alert("请选择招聘目的及说明", {
            title: "提示信息",
            time: 1500
        });
        return false;
    }
    if (!job.TimeStart) {
        layer.alert("请选择报名开始时间", {
            title: "提示信息",
            time: 1500
        });
        return false;
    }
    if (!job.TimeEnd) {
        layer.alert("请选择报名结束时间", {
            title: "提示信息",
            time: 1500
        });
        return false;
    }
    if (new Date(job.TimeStart) > new Date(job.TimeEnd)) {
        layer.alert("报名结束时间不能小于开始时间", {
            title: "提示信息",
            time: 1500
        });
        return false;
    }
    if (!job.Linkman) {
        layer.alert("联系人不能为空", {
            title: "提示信息",
            time: 1500
        });
        return false;
    }
    if (!isPhoneNumber(job.Contacts)) {
        layer.alert("请输入正确的联系电话", {
            title: "提示信息",
            time: 1500
        });
        return false;
    }
    if ((job.Email.length > 0) && (!isEmail(job.Email))) {
        layer.alert("请输入正确的邮箱", {
            title: "提示信息",
            time: 1500
        });
        return false;
    }
    if ((!job.ListRange) || (!job.ListRange.length)) {
        layer.alert("请选择招聘面向单位", {
            title: "提示信息",
            time: 1500
        });
        return false;
    }
    return true;
}

function setUserInfo() {
    zxzpZpgg.userInfo = window.userInfo;
}

function setDropdown() {
    zxzpZpgg.notice.dropdownList.years = window.initDropdownList.ND;
    zxzpZpgg.notice.dropdownList.units = window.initDropdownList.ZPMXDW;
    zxzpZpgg.notice.dropdownList.positionLoctionList = window.initDropdownList.GZDD;
    zxzpZpgg.notice.dropdownList.positionTypeList = window.initDropdownList.GWLB;
    zxzpZpgg.notice.dropdownList.sszy = window.initDropdownList.SSZY;
    zxzpZpgg.notice.dropdownList.sszygz = window.initDropdownList.SSZYGZ;
    zxzpZpgg.notice.dropdownList.xlyq = window.initDropdownList.XLYQ;
    zxzpZpgg.notice.dropdownList.zcyq = window.initDropdownList.ZCYQ;
    zxzpZpgg.notice.dropdownList.zndj = window.initDropdownList.ZNDJ;
}

function submitNotice() {
    var data = {
        jobId: zxzpZpgg.notice.jobId
    }
    $.post(SubmitNotice, data, function(result) {
        if (result.Status == true) {
            alert('已提交审核');
        }
        $("#closeViewJob").click();
        getJobListByStatus(false, 10, 'process', 5, 1);
    }, 'json');
}

function hideEditJob(e) {
    var e = e || event;
    if (e.target.id == 'editJob' || e.target.id == "closeEditJob") {
        $("#editJob").removeClass('in');
        setTimeout(function() {
            $("#editJob").hide();
        }, 500);
        $("#editJobModal").remove();
    }
}

function hideViewJob(e) {
    var e = e || event;
    if (e.target.id == 'viewJob' || e.target.id == "closeViewJob") {
        $("#viewJob").removeClass('in');
        setTimeout(function() {
            $("#viewJob").hide();
        }, 500);
        $("#viewJobModal").remove();
    }
}

function zxzpZpggInit() {
    snTab($("#zxzpZpggList"));
    getDefault();
    var options = zxzpZpgg.notice.dropdownList.units;
    for (var i = options.length - 1; i >= 0; i--) {
        options[i].id = options[i].DeptID;
        options[i].name = options[i].Name;
    }
    $("#zxzpZpgg .checks_v").each(function(index, el) {
        $(el).checks_select(options);
    });
}
var getJobPageByStatus = {
    draft: function(curr) {
        getJobListByStatus(false, 0, 'draft', 5, curr);
    },
    process: function(curr) {
        getJobListByStatus(false, 10, 'process', 5, curr);
    },
    publish: function(curr) {
        getJobListByStatus(false, 11, 'publish', 5, curr);
    },
    notPass: function(curr) {
        getJobListByStatus(false, 12, 'notPass', 5, curr);
    },
    offLine: function(curr) {
        getJobListByStatus(false, 9, 'offLine', 5, curr);
    }
};

function getDefault() {
    //草稿
    getJobListByStatus(true, 0, 'draft');
    //审批中
    getJobListByStatus(true, 10, 'process');
    //发布中
    getJobListByStatus(true, 11, 'publish');
    //不通过
    getJobListByStatus(true, 12, 'notPass');
    //下线
    getJobListByStatus(true, 9, 'offLine');
}

function getJobListByStatus(isPage, status, tabName, pageSize, pageIndex) {
    var isPage = isPage || false;
    var pageSize = pageSize || 5;
    var pageIndex = pageIndex || 1;
    $.post(GetJobZXListByStatus, {
        status: status,
        pageSize: pageSize,
        pageIndex: pageIndex,
        keyword: zxzpZpgg.searchText
    }, function(result) {
        if (result.Status == true) {
            for (var i = 0; i < result.Message.List.length; i++) {
                var item = result.Message.List[i];
            }
            zxzpZpgg.noticeList[tabName].data = result.Message.List;
            zxzpZpgg.noticeList[tabName].total = result.Message.RecordCount;
            //创建分页            
            createPage(status, tabName, pageSize, result.Message.RecordCount);
        }
    }, 'json');
}

function createPage(status, tabName, pageSize, total) {
    $('#' + tabName + 'ListPager').html("");
    $('#' + tabName + 'ListPager').extendPagination({
        totalCount: total,
        showCount: pageSize,
        limit: 5,
        callback: getJobPageByStatus[tabName]
    });
}

function snTab(outter) {
    outter.find(".sn-tab-nav-item").click(function(event) {
        var index = $(this).index();
        $(this).siblings().removeClass('active');
        $(this).addClass('active');
        $(this).parent().next().find(".sn-tab-body-item").hide().eq(index).show();
    });
}

function updateNotice() {
    var data = zxzpZpgg.notice.editJob.$model;
    var keys = $("#editJob .enterprise").attr('keys').split(',');
    var options = zxzpZpgg.notice.dropdownList.units.$model;
    var newPotions = [];
    for (var i = 0; i < options.length; i++) {
        for (var j = 0; j < keys.length; j++) {
            if (options[i].DeptID == keys[j]) {
                newPotions.push({
                    DepartmentId: options[i].DeptID,
                    StartZXID: options[i].Id
                });
            }
        }
    }
    data.ListRange = newPotions;
    var isJob = verifyJob(data);
    if (!isJob) {
        return;
    }
    var postData = {
        json: JSON.stringify(data)
    }
    $.post(UpdateInternalJob, postData, function(result) {
        if (result.Status == true) {
            layer.alert("修改成功", {
                title: "提示信息",
                time: 1500
            })
            $("#closeEditJob").click();
            zxzpZpgg.notice.jobId = result.Message;
            getJobListByStatus(false, 0, 'draft', 5, 1);
            getJobListByStatus(false, 0, 'offLine', 5, 1);
        }
    }, 'json');
}

function saveNotice() {
    var data = zxzpZpgg.notice.newJob.$model;
    var keys = $("#newJob .enterprise").attr('keys').split(',');
    var options = zxzpZpgg.notice.dropdownList.units.$model;
    var newPotions = [];
    for (var i = 0; i < options.length; i++) {
        for (var j = 0; j < keys.length; j++) {
            if (options[i].DeptID == keys[j]) {
                newPotions.push({
                    DepartmentId: options[i].DeptID,
                    StartZXID: options[i].Id
                });
            }
        }
    }
    data.ListRange = newPotions;
    var isJob = verifyJob(data);
    if (!isJob) {
        return;
    }
    var postData = {
        json: JSON.stringify(data)
    }
    $.post(SaveInternalJob, postData, function(result) {
        layer.alert("保存成功", {
            title: "提示信息",
            time: 1500
        });
        $("#closeNewJob").click();
        if (result.Status == true) {
            zxzpZpgg.notice.jobId = result.Message;
            getJobListByStatus(false, 0, 'draft', 5, 1);
        }
    }, 'json');
}

function savePosition() {
    var data = zxzpZpgg.notice.newPosition.$model;
    data.JobId = zxzpZpgg.notice.jobId;
    var postData = {
        json: JSON.stringify(data)
    };
    var res = verifyPosition(data);
    if (!res) {
        return;
    }
    $.post(AddInternalPosition, postData, function(result) {
        layer.alert("保存成功", {
            title: "提示信息",
            time: 1500
        });
        GetPositionByJobId(zxzpZpgg.notice.jobId);
        $("#cancelSavePostion").click();
    });
}

function updatePosition() {
    //更新岗位
    var data = zxzpZpgg.notice.editPosition.$model;
    var postData = {
        json: JSON.stringify(data)
    };
    var res = verifyPosition(data);
    if (!res) {
        return;
    }
    $.post(UpdateInternalPosition, postData, function(result) {
        layer.alert("修改成功", {
            title: "提示信息",
            time: 1500
        });
        GetPositionByJobId(zxzpZpgg.notice.jobId);
        $("#cancelUpdatePosition").click();
    });
}

function GetPositionByJobId(id) {
    var data = {
        jobId: id
    }
    $.post(GetPositionZXByJobId, data, function(result) {
        if (result.Status == true) {
            zxzpZpgg.notice.positionList = result.Message;
        }
    }, 'json')
}

function clearInput() {
    return false;
}
</script>
